﻿<%@ Page Language="C#" MasterPageFile="~/CmsMaster.Master" AutoEventWireup="true" CodeBehind="ListContractor.aspx.cs" Inherits="ContractManagementSystem.Presentation.ProfileManagement.ListContractor" Title="Profile Manager >>> List Contractor" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link rel="Stylesheet" type="text/css" href="../../Styles/ClientStyle.css" />

    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/JsLibrary.js"> </script>    
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/jquery.js"> </script>
    <script type = "text/javascript" language = "javascript" src = "../../JavaScript/menu.js"> </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <div class="CPF">
        <h3 class="CPFtitle"></h3>
        <div class="CPFSearch">
            <div class="CPFclientleft">
                <asp:Label ID="Label1" runat="server">Full Name:</asp:Label>
            </div>
            <div class="CPFclientright">
                <asp:TextBox runat="server" ID="textFullName" CssClass="CPFTextBox"></asp:TextBox>
            </div>
            <div class="CPFclientleft">
                <asp:Label ID="Label2" runat="server">Email:</asp:Label>
            </div>
            <div class="CPFclientright">
                <asp:TextBox runat="server" ID="textEmail" CssClass="CPFTextBox"></asp:TextBox>
            </div>
            <div class="CPFButtonSearch">
                <asp:Button runat="server" ID="ButtonSearch" Text="Search" 
                            CssClass="CPFButton1" onclick="ButtonSearchClick"
                    />
            </div>
        </div>
        
        <div style="font-size: 14px; margin: 15px;">
            <asp:Label runat="server" ID="labelResult" CssClass="CPFResultsMessage"></asp:Label>
        </div>
        
        <div class="CPFGrid">
            <asp:ListView ID="ListViewContractor" runat="server" OnItemCommand="ListViewContractorItemCommand"
                          OnItemDeleting="ListViewContractorItemDeleting" >
                <LayoutTemplate>
                    <table class="repeaterTable">
                        <tr class="tableHeader">

                            <td>
                                UserName
                            </td>
                            <td>
                                FullName
                            </td>
                            <td>
                                Email
                            </td>
                            <td>
                                PhoneNumber1
                            </td>
                            <td>
                                PhoneNumber2
                            </td>
                            <td>
                                Address
                            </td>
                            <td>
                                Branch
                            </td>
                            <td>
                                SortCode
                            </td>
                            <td>
                                Action
                            </td>
                        </tr>
                        <tr id="itemPlaceholder" runat="server">
                        </tr>
                    </table>
                
                    <table class="CPFrepeaterTable" >
                        <tr class="CPFtableHeader">
                            <td class="CPFPage">
                                <asp:DataPager runat="server" ID="ItemDataPager" PageSize="10">
                                    <Fields>
                                        <asp:NextPreviousPagerField ShowFirstPageButton="true" ShowNextPageButton="false" ButtonCssClass="CPFNumPage" />
                                        <asp:NumericPagerField ButtonCount="5" CurrentPageLabelCssClass="CPFCurrentNumPage" NumericButtonCssClass="CPFNumPage"/>
                                        <asp:NextPreviousPagerField ShowLastPageButton="true" ShowPreviousPageButton="false" ButtonCssClass="CPFNumPage" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                
                </LayoutTemplate>
                <ItemTemplate>
                    <tr class="CPFTr">

                        <td class="CPFtd" style="width: 100px">
                            <asp:Label ID="labelUserName" runat="server"><%#DataBinder.Eval(Container.DataItem, "UserName")%></asp:Label>
                        </td>
                        <td class="CPFtd" style="width: 250px;">
                            <a href="ViewContractor.aspx?id=<%#Eval("ContractorID")%>">
                                <asp:Label ID="labelFullName" runat="server"><%#DataBinder.Eval(Container.DataItem, "FullName")%></asp:Label>
                            </a>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelEmail" runat="server"><%#DataBinder.Eval(Container.DataItem, "Email")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelPhoneNumber1" runat="server"><%#DataBinder.Eval(Container.DataItem, "PhoneNumber1")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelPhoneNumber2" runat="server"><%#DataBinder.Eval(Container.DataItem, "PhoneNumber2")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelAddress" runat="server"><%#DataBinder.Eval(Container.DataItem, "Address")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelBranch" runat="server"><%#DataBinder.Eval(Container.DataItem, "Branch")%></asp:Label>
                        </td>
                        <td class="CPFtd">
                            <asp:Label ID="labelSortCode" runat="server"><%#DataBinder.Eval(Container.DataItem, "SortCode")%></asp:Label>
                        </td>
                        <td class="CPFtd" >
                            <asp:LinkButton ID="LinkButton1" runat="server" OnClientClick='javascript:return confirm("Are you sure you want to delete?")' CommandName="Delete" CommandArgument='<%#Eval("ContractorId")%>'>
                                <asp:Image ID="Image1" runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFdelete.png">
                                </asp:Image>
                            </asp:LinkButton>
                            
                            <a href="UpdateContractor.aspx?id=<%#Eval("ContractorId")%>">
                                <asp:Image ID="Image2" runat="server" CssClass="CPFdelete" ImageUrl="../../Images/CPFedit.png">
                                </asp:Image>
                            </a>
                        </td>
                    </tr>
                </ItemTemplate>
                
                <EmptyItemTemplate>
                    <label style="text-align: center; color: #FF0000; font-size: 18px;">Not data</label>
                </EmptyItemTemplate>
                <EmptyDataTemplate>
                    <table class="repeaterTable">
                        <tr class="tableHeader">

                            <td>
                                UserName
                            </td>
                            <td>
                                FullName
                            </td>
                            <td>
                                Email
                            </td>
                            <td>
                                PhoneNumber1
                            </td>
                            <td>
                                PhoneNumber2
                            </td>
                            <td>
                                Address
                            </td>
                            <td>
                                Branch
                            </td>
                            <td>
                                SortCode
                            </td>
                            <td>
                                Action
                            </td>
                        </tr>
                        <tr>
                            <td colspan="9" class="CPFNotData">
                                <label style="color: #FF0000; font-size: 18px;">Sorry ! no data found</label>
                            </td>                            
                        </tr>
                    </table>
                </EmptyDataTemplate> 
                
            </asp:ListView>
        </div>    
            

                    
    </div>
</asp:Content>